﻿using RabbitMQ.Client;
using System;

namespace Common
{
    public abstract class RabbitMQ
    {
        private static IConnectionFactory Factory;
        static RabbitMQ()
        {
            Factory = new ConnectionFactory
            {
                HostName = "127.0.0.1",
                Port = 5672,
                UserName = "admin",
                Password = "admin"
            };
        }
        public static IModel GetChannel()
        {
            var connection = Factory.CreateConnection();
            return connection.CreateModel();
        }
    }
}
